package net.sxnic.ugr.menu.util;

import java.util.Comparator;

import net.sxnic.ugr.menu.Menu;

@SuppressWarnings("rawtypes")
public class MenuComparator implements Comparator{

	public int compare(Object arg0, Object arg1) {
		Menu menu0 = (Menu) arg0;
		Menu menu1 = (Menu) arg1;
		// 比较code
		 int flag =  menu0.getMenuOrder() - menu1.getMenuOrder() ;
		  if (flag==0)
		  {
			  flag = menu0.getCode().compareTo(menu1.getCode());
		  }
	 
		return  flag;

	}
}
